package cc.wsyw126.java.nowcoder;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/4/12.
 */
public class BalanceNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String s = scanner.nextLine();
            if (s == null || s.length() <= 1) {
                System.out.println("NO");
                continue;
            }
            StringBuilder stringBuilder = new StringBuilder(s);
            int count = 0;
            for (int i = 1; i < s.length()-1; i++) {
                if (s.charAt(i) == '0') {
                    count++;
                    for (int j = i + 1; j < s.length()-1; j++, i++) {
                        if (s.charAt(j) != '0') {
                            break;
                        }
                        stringBuilder.replace(j,j+1, "1");
                    }
                }
            }
            if (s.charAt(s.length() -1) == '0') {
                count++;
            }
            if (count == 2) {
                System.out.println("YES");
                continue;
            }else if (count ==1){
                System.out.println("NO");
                continue;
            }
            int left = s.charAt(0) - '0';
            int right = 1;
            for (int i = 1; i < s.length(); i++) {
                right *= s.charAt(i) - '0';
            }
            boolean result = false;
            if (right == left) {
                result = true;
            } else {
                for (int i = 1; i < s.length() - 1; i++) {
                    if (s.charAt(i) == '0') {
                        for (int j = i + 1; i < s.length() - 1; j++) {
                            if (s.charAt(j) == '0') {
                                result = true;
                                break;
                            }
                        }
                        break;
                    }
                    left *= s.charAt(i) - '0';
                    right /= s.charAt(i) - '0';
                    if (right == left) {
                        result = true;
                        break;
                    }
                }
            }
            System.out.println(result ? "YES" : "NO");
        }
    }
}
